package com.gomore.opple.data.remote.retrofit;

import com.gomore.opple.exception.ExceptionEngine;

import rx.Observable;
import rx.functions.Func1;

/**
 * Company 上海勾芒科技有限公司.
 */
public class HttpResponseFunc<T> implements Func1<Throwable, Observable<T>> {
    @Override
    public Observable<T> call(Throwable throwable) {
        //ExceptionEngine为处理异常的驱动器
        return Observable.error(ExceptionEngine.handleException(throwable));
    }
}